package com.spring.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

/**
 * @author Tang
 */
@Controller
@RequestMapping("user")
public class UserController {

    @RequestMapping(value="/login",method= RequestMethod.GET)
    public String getLogin(){
        return "user/login";
    }
    @RequestMapping(value="/login",method = RequestMethod.POST)
    public String Login(@RequestParam("name") String name, @RequestParam("psw") String psw, HttpServletRequest req,
                        HttpServletResponse res, HttpSession session, ModelAndView mv)throws IOException {

        return "index";
    }
}
